package com.eeds.common.enums;

import com.eeds.common.enums.base.BaseEnum;

/**
 * @Author Flying
 * @Description  登录端类型
 * @Date 16:18 2019/3/18
 * @Param 
 * @return 
 **/
public enum LoginType implements BaseEnum {
    /**
     * 原生APP
     */
    NAPP(1, "APP"),
    /**
     * 微信小程序
     */
    WAPP(2,"小程序"),
    /**
     * 微信公众号
     */
    WWEB(3, "微信公众号"),

    ;

    private final Integer value;

    private final String description;

    LoginType(Integer value, String description){
        this.value = value;
        this.description = description;
    }

    public static LoginType valueOf(Integer value) {
        for (LoginType item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public static LoginType descriptionOf(String description) {
        for (LoginType item : values()) {
            if (item.getDescription().equals(description)) {
                return item;
            }
        }
        return null;
    }


    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public LanguageType get(Integer value) {
        return LanguageType.valueOf(value);
    }


    @Override
    public String toString() {
        return String.valueOf(this.value);
    }
}